package com.yuju.hotel.enums;
/**
 * 
 * 类名：RoomTypeReturnCodeEnum  <br />
 *
 * 功能：房型相关返回值
 *
 * @author : zhousc <br />
 * @Date : 2017年11月27日 下午2:18:23  <br />
 * @version : 1.1 <br />
 */
public enum RoomTypeReturnCodeEnum {
	ROOMTYPE_QUERY_SUCCESS("yuju-roomType-1000", "房间类型查询成功"),
	ROOMTYPE_QUERY_FAILURE("yuju-roomType-1001", "房间类型查询失败"),
	ROOMTYPE_SAVE_SUCCESS("yuju-roomType-1002", "房间类型保存成功"),
	ROOMTYPE_SAVE_FAILURE("yuju-roomType-1003", "房间类型保存失败"),
	ROOMTYPE_UPDATE_SUCCESS("yuju-roomType-1004", "房间类型更新成功"),
	ROOMTYPE_UPDATE_FAILURE("yuju-roomType-1005", "房间类型更新失败"),
	ROOMTYPE_DEL_SUCCESS("yuju-roomType-1006", "房间类型删除成功"),
	ROOMTYPE_DEL_FAILURE("yuju-roomType-1007", "该房间类型下有房间存在"),
	ROOMTYPE_VALID_SUCCESS("yuju-roomType-1008", "校检成功"),
	ROOMTYPE_VALID_FAILURE("yuju-roomType-1009", "校检失败");
	
	
	private String code;
	private String desc;
	
	RoomTypeReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (RoomTypeReturnCodeEnum enume : RoomTypeReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}